module.exports = {
  description: 'generate a component',
  prompts: [
    {
      type: 'input',
      name: 'name',
      message: 'component name (kebabCase, such as "member-modal") please',
    },
  ],
  actions: (data) => {
    const name = '{{name}}';
    const actions = [
      {
        type: 'add',
        path: `src/components/${name}/index.tsx`,
        templateFile: 'plop-templates/component/index.hbs',
        data: { name },
      },
      {
        type: 'add',
        path: `src/components/${name}/index.module.less`,
        templateFile: 'plop-templates/component/less.hbs',
        data: { name },
      },
    ];

    return actions;
  },
};
